/*
 * MCAL_IO.h
 *
 *  Created on: Sep 24, 2025
 *      Author: ADMIN
 */

#ifndef BSW_MACL_INC_MCAL_IO_H_
#define BSW_MACL_INC_MCAL_IO_H_

/***********************************************************************************
 ********************************************************************************
 *--------------------------------------------------------------------------
 *                            FILE DESCRIPTION
 *--------------------------------------------------------------------------
 *
 *    File Name    :     MCAL_IO.h
 *    File Module  :     BSW_MCAL
 *    File Description:  This file is used to define struct and function about
 *                       IO Control.
 *
 *
 ********************************************************************************
 ***********************************************************************************/

#include "All_In_One.h"

/* OUPUT IO CONTROL STRUCT */
typedef struct OutputIO_ID_Type OutputIO_ID_Type;
struct OutputIO_ID_Type{
	/* SW information */
	GPIO_TypeDef* io_port;
	uint16_t io_pin;
	boolean io_est;

	/* Function Index */
	Std_ReturnType (*Set_High)    (struct  OutputIO_ID_Type* id);
	Std_ReturnType (*Set_Low)     (struct  OutputIO_ID_Type* id);
	Std_ReturnType (*UpdateStatus)(struct  OutputIO_ID_Type* id);
};


#define IO_HIGH_PIN    1
#define IO_LOW_PIN     0

/* OUPUT IO CONTROL FUNCTION */
Std_ReturnType MCAL_OutputIO_Init(void);
Std_ReturnType MCAL_OutputIO_DeInit(void);
Std_ReturnType OutputIO_Set_High(OutputIO_ID_Type* id);
Std_ReturnType OutputIO_Set_Low(OutputIO_ID_Type* id);
Std_ReturnType OutputIO_UpdateStatus(OutputIO_ID_Type* id);
void OutputIO_Creat(OutputIO_ID_Type* id,GPIO_TypeDef* port,uint16_t pin);

/* Be defined GLOABAL OUTPUTIO_ID */
extern OutputIO_ID_Type OutPutIO_ID_A3;
#define Green_LED_Type	OutPutIO_ID_A3

extern OutputIO_ID_Type OutPutIO_ID_E0;
#define RS485_ComtralIO	OutPutIO_ID_E0

extern OutputIO_ID_Type OutPutIO_ID_A0;
#define Blue_LED_Type	OutPutIO_ID_A0

extern OutputIO_ID_Type OutPutIO_ID_D3;
#define FlashCs_IO_Type	OutPutIO_ID_D3
#endif /* BSW_MACL_INC_MCAL_IO_H_ */
